@echo off
setlocal
if "%JAVA_HOME%"=="" goto tryharder
goto run

:tryharder
if not exist ../jre/nul goto error
SET JAVA_HOME=../jre


:run
set CLASSPATH=%CLASSPATH%;%CD%\kit\gridgainoptimizer.jar;%CD%\kit\activation-1.0.2.jar;%CD%\kit\aspectjrt-1.5.3.jar;%CD%\kit\aspectjweaver-1.5.3.jar;%CD%\kit\commons-logging-1.0.3.jar;%CD%\kit\concurrent-1.3.jar;%CD%\kit\edtftpj-1.5.6.jar;%CD%\kit\gridgain-1.6.1.jar;%CD%\kit\imap-1.4.jar;%CD%\kit\jakarta-oro-2.0.8.jar;%CD%\kit\javassist-4.0.4.jar;%CD%\kit\jboss-serialization-1.0.2.jar;%CD%\kit\jgroups-all-2.2.9.3.jar;%CD%\kit\jms-1.1.jar;%CD%\kit\jmxri-1.2.1.jar;%CD%\kit\jmxtools-1.2.1.jar;%CD%\kit\jnpserver-4.0.4.jar;%CD%\kit\junit-4.4.jar;%CD%\kit\log4j-1.2.15.jar;%CD%\kit\mailapi-1.4.jar;%CD%\kit\optimizer-0.0.180.jar;%CD%\kit\optimizer-docs-0.0.180.zip;%CD%\kit\optimizer-src-0.0.180.zip;%CD%\kit\pop3-1.4.jar;%CD%\kit\smtp-1.4.jar;%CD%\kit\spring-2.0.jar;%CD%\kit\tidy-04aug2000-r7.jar;%CD%\kit\trove-1.0.2.jar
"%JAVA_HOME%\bin\java.exe" -classpath "%CLASSPATH%" org.dyndns.opendemogroup.gridgainoptimizer.DistributedRunDriver %1 %2 %3 %4 %5 %6 %7 %8 %9
goto fin

:error
echo.
echo ERROR:  The environment variable JAVA_HOME is not set!  It must point to JDK 1.5
echo.

:fin
endlocal
